package cn.lstf666.springboot.service;


import cn.lstf666.springboot.mapper.StudentMapper;
import cn.lstf666.springboot.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public String updateStudent(Integer id, String name) {

        Student student = new Student();
        student.setId(id);
        student.setName(name);
        int i = studentMapper.updateByPrimaryKeySelective(student);

        int a = 10/0;
        return "修改结果是"+i;
    }
}
